package com.vueblog.controller;

import com.alibaba.fastjson.JSONObject;
import com.vueblog.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ArchivesController {
    @Autowired
    private BlogService blogService;


    @GetMapping("/archives")
    public Object archives(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("archiveMap",blogService.archiveShowBlog());
        jsonObject.put("countBlog",blogService.countShowBlog());
        return jsonObject;
    }
}
